package com.example.node;

import com.example.ProcessFlowContext;
import com.example.domain.Order;
import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.core.NodeComponent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@LiteflowComponent(id = "create0rder", name = "创建订单节点")
@Component
@Slf4j
public class Create0rderNode extends NodeComponent {
    @Override
    public void process() throws Exception {
        ProcessFlowContext context = this.getContextBean(ProcessFlowContext.class);
        Order order = context.getOrder();
        // 将 order 对象保存到数据库
        log.info("订单创建成功：{}", order);
    }
}
